package org.zn.mvcbase.filter;



import java.io.IOException;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import org.apache.catalina.filters.HttpHeaderSecurityFilter;

/**  
*
* @Company OBOR 
* @author 周楠
* @Description: 
* @date 2018年2月27日
*
*/

/*
@WebFilter(urlPatterns = "/*")
@Order(value = 1) 
*/ 
public class XssFilter  extends HttpHeaderSecurityFilter{


	@Override
	public void init(FilterConfig filterConfig) throws ServletException {
		// TODO Auto-generated method stub
		
		System.out.println("XssFilter init ");
		super.init(filterConfig);
		
	}

	@Override
	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
			throws IOException, ServletException {
				
		  Map<String, String[]> parmMap = request.getParameterMap();
		
		  Set<Entry<String, String[]>>  EntrySet=  parmMap.entrySet();
		  
		  for (Entry<String, String[]> entry : EntrySet) {
			  
			String key= entry.getKey();
			
			Object value= entry.getValue();
			
			if(value instanceof String[]) {
				
				String[] strs=(String[]) value;
				
				
						
			}else if(value instanceof String[]) {
				
				
				
				String str=(String) value;
				
				
			}
			
		}
		  
		  
		super.doFilter(request, response, chain);
	
	}

	
	@Override
	public void destroy() {
		// TODO Auto-generated method stub
		super.destroy();
	}

	
	
	
}
